<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>作用域</title>
</head>
<body>
<div id="app">
    <message>
        <template v-slot:box="props">
            <h1>{{props.message}}-<small>{{props.test}}</small></h1>
        </template>
    </message>

  <!-- wrong: {{props.test}}-->
</div>
</body>
<script src="../../lib/vue.js"></script>
<script>

    var message = {
        template:'<div class="box"><slot name="box" :message="msg" test="test1"></slot></div>',
        data:function () {
            return {
                 msg:'hello'
            }
        }
    }

    new Vue({
        el:'#app',
        components:{
            message
        }
    })

</script>
</html>